package com.company.jvm.classloader;

import lombok.Data;

import java.util.ArrayList;

/**
 * @Classname ref
 * @Description TODO  引用测试
 * @Date 2021/8/2 17:42
 * @Created by ylr
 */

@Data
public class ref {
    private A a1;
    private A a2;
    private A a3;

    public static void main(String[] args) {
        A a = new A();


        ref ref = new ref();
        a.setS1(1);
        a.setS2(1);
        a.setS3(1);
        ref.setA1(a);
        a.setS1(2);
        a.setS2(2);
        a.setS3(2);
        ref.setA2(a);
        a.setS1(3);
        a.setS2(3);
        a.setS3(3);
        ref.setA3(a);

        System.out.println(ref.toString());


    }
}


@Data
class A{
    private int s1;
    private int s2;
    private int s3;
}